<template>
  <view class="teacher-info-container">
    <!-- 左侧头像 -->
    <image class="teacher-avatar" src="@/static/video_preview/爬.png" />

    <!-- 中间教师信息 -->
    <view class="teacher-details">
      <text class="teacher-name">{{ teacher.teacherName }}</text>
      <text class="teacher-remark">{{ teacher.teacher_remake }}</text>
    </view>

    <!-- 右侧关注按钮 -->
    <button class="follow-button">+ 关注</button>
  </view>
</template>

<script>
import { mapState } from 'vuex';

export default {
  data() {
    return {
      teacher: {} // 用于存储深复制后的教师数据
    };
  },
  created() {
    // 在组件创建时进行深复制
    this.teacher = JSON.parse(JSON.stringify(this.$store.state.videoAbout.teacher));
  }
};
</script>

<style scoped>
.teacher-info-container {
  display: flex;
  align-items: center;
  padding: 10px; /* 上下左右边距 */
  background-color: #ffffff;
  border-radius: 8px;
}

.teacher-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin-right: 10px;
  object-fit: cover;
}

.teacher-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.teacher-name {
  font-weight: bold;
  color: #333;
  font-size: 16px;
}

.teacher-remark {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

.follow-button {
  padding: 0 25px;
  background-color: #007bff;
  color: #ffffff;
  font-size: 14px;
  border: none;
  height: 70%;
  border-radius: 100px;
  cursor: pointer;
}
</style>
